﻿using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace DFGK_WMS.Context.Migrations
{
    public partial class 出库表修改字段 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "MaterialCategoryId",
                table: "TShippingOrderDetails");

            migrationBuilder.DropColumn(
                name: "MaterialCategoryName",
                table: "TShippingOrderDetails");

            migrationBuilder.DropColumn(
                name: "MaterialCode",
                table: "TShippingOrderDetails");

            migrationBuilder.DropColumn(
                name: "MaterialId",
                table: "TShippingOrderDetails");

            migrationBuilder.DropColumn(
                name: "MaterialName",
                table: "TShippingOrderDetails");

            migrationBuilder.DropColumn(
                name: "MaterialTypeCode",
                table: "TShippingOrderDetails");

            migrationBuilder.DropColumn(
                name: "ModelSpec",
                table: "TShippingOrderDetails");

            migrationBuilder.DropColumn(
                name: "PackQty",
                table: "TShippingOrderDetails");

            migrationBuilder.DropColumn(
                name: "PickedQty",
                table: "TShippingOrderDetails");

            migrationBuilder.DropColumn(
                name: "Qty",
                table: "TShippingOrderDetails");

            migrationBuilder.DropColumn(
                name: "QualityState",
                table: "TShippingOrderDetails");

            migrationBuilder.DropColumn(
                name: "ShippedQty",
                table: "TShippingOrderDetails");

            migrationBuilder.DropColumn(
                name: "UnitId",
                table: "TShippingOrderDetails");

            migrationBuilder.DropColumn(
                name: "UnitName",
                table: "TShippingOrderDetails");

            migrationBuilder.DropColumn(
                name: "WarehouseCode",
                table: "TShippingOrderDetails");

            migrationBuilder.DropColumn(
                name: "WarehouseName",
                table: "TShippingOrderDetails");

            migrationBuilder.RenameColumn(
                name: "RoutewayId",
                table: "TShippingLockCells",
                newName: "UnitId");

            migrationBuilder.RenameColumn(
                name: "MaterialKeyId",
                table: "TShippingLockCells",
                newName: "MaterialCategoryId");

            migrationBuilder.RenameColumn(
                name: "BatchNo",
                table: "TShippingLockCells",
                newName: "UnitName");

            migrationBuilder.RenameColumn(
                name: "BatchNo",
                table: "TInventories",
                newName: "ModelSpec");

            migrationBuilder.AlterColumn<decimal>(
                name: "StackingStorageId",
                table: "TShippingLockCells",
                type: "decimal(18,2)",
                nullable: true,
                oldClrType: typeof(int),
                oldType: "int",
                oldNullable: true);

            migrationBuilder.AddColumn<string>(
                name: "MaterialCategoryCode",
                table: "TShippingLockCells",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "MaterialCategoryName",
                table: "TShippingLockCells",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "ModelSpec",
                table: "TShippingLockCells",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "QualityState",
                table: "TShippingLockCells",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<decimal>(
                name: "TotalPrice",
                table: "TShippingLockCells",
                type: "decimal(18,2)",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "MaterialCategoryCode",
                table: "TInventories",
                type: "nvarchar(max)",
                nullable: true);
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "MaterialCategoryCode",
                table: "TShippingLockCells");

            migrationBuilder.DropColumn(
                name: "MaterialCategoryName",
                table: "TShippingLockCells");

            migrationBuilder.DropColumn(
                name: "ModelSpec",
                table: "TShippingLockCells");

            migrationBuilder.DropColumn(
                name: "QualityState",
                table: "TShippingLockCells");

            migrationBuilder.DropColumn(
                name: "TotalPrice",
                table: "TShippingLockCells");

            migrationBuilder.DropColumn(
                name: "MaterialCategoryCode",
                table: "TInventories");

            migrationBuilder.RenameColumn(
                name: "UnitName",
                table: "TShippingLockCells",
                newName: "BatchNo");

            migrationBuilder.RenameColumn(
                name: "UnitId",
                table: "TShippingLockCells",
                newName: "RoutewayId");

            migrationBuilder.RenameColumn(
                name: "MaterialCategoryId",
                table: "TShippingLockCells",
                newName: "MaterialKeyId");

            migrationBuilder.RenameColumn(
                name: "ModelSpec",
                table: "TInventories",
                newName: "BatchNo");

            migrationBuilder.AddColumn<int>(
                name: "MaterialCategoryId",
                table: "TShippingOrderDetails",
                type: "int",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "MaterialCategoryName",
                table: "TShippingOrderDetails",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "MaterialCode",
                table: "TShippingOrderDetails",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "MaterialId",
                table: "TShippingOrderDetails",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<string>(
                name: "MaterialName",
                table: "TShippingOrderDetails",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "MaterialTypeCode",
                table: "TShippingOrderDetails",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "ModelSpec",
                table: "TShippingOrderDetails",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "PackQty",
                table: "TShippingOrderDetails",
                type: "int",
                nullable: true);

            migrationBuilder.AddColumn<decimal>(
                name: "PickedQty",
                table: "TShippingOrderDetails",
                type: "decimal(18,2)",
                nullable: true);

            migrationBuilder.AddColumn<decimal>(
                name: "Qty",
                table: "TShippingOrderDetails",
                type: "decimal(18,2)",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "QualityState",
                table: "TShippingOrderDetails",
                type: "int",
                nullable: true);

            migrationBuilder.AddColumn<decimal>(
                name: "ShippedQty",
                table: "TShippingOrderDetails",
                type: "decimal(18,2)",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "UnitId",
                table: "TShippingOrderDetails",
                type: "int",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "UnitName",
                table: "TShippingOrderDetails",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "WarehouseCode",
                table: "TShippingOrderDetails",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "WarehouseName",
                table: "TShippingOrderDetails",
                type: "nvarchar(max)",
                nullable: true);

            migrationBuilder.AlterColumn<int>(
                name: "StackingStorageId",
                table: "TShippingLockCells",
                type: "int",
                nullable: true,
                oldClrType: typeof(decimal),
                oldType: "decimal(18,2)",
                oldNullable: true);
        }
    }
}
